home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / examples / Readme < prev    next >
Text File  |  1997-07-22  |  7KB  |  253 lines

  1.  PVM Version 3.4
  2.  EXAMPLES
  3.  _____________________________________________________________________
  4.  
  5.  This directory contains C and FORTRAN example programs using PVM 3.4
  6.  
  7.  All examples assume that pvm is installed and currently running.
  8.  
  9.  Each target can be made separately by typing in
  10.  
  11.      % aimk <target>
  12.  
  13.  Each section tells how to compile the example, run the example,
  14.  and what output is expected. Some of the examples run slightly
  15.  differently on MPPs (PGON and SP2MPI), the difference are noted,
  16.  where applicable in the section "MPP notes".
  17.  
  18.  ===============================================================
  19.  1.) hello + hello_other:
  20.      Two programs that cooperate - shows how to create a new task
  21.      and pass messages between tasks.
  22.      
  23.      Source files:
  24.          hello.c hello_other.c
  25.  
  26.      To compile:
  27.          % aimk hello hello_other
  28.  
  29.      Run from shell:
  30.          % hello
  31.  
  32.      Run from pvm console:
  33.          pvm> spawn -> hello
  34.  
  35.      Sample output:
  36.          i'm t40002
  37.          from t40003: hello, world from gollum.epm.ornl.gov
  38.  
  39.      MPP Notes:
  40.          If you desire to run the hello example from the shell, then
  41.          you need to compile the "helloh"
  42.          % aimk helloh
  43.          % helloh
  44.  
  45.  
  46.  ===============================================================
  47.  2.) master1 + slave1, fmaster1 + fslave1
  48.      A master/slave example where the master process creates and
  49.      directs some number of slave processes that cooperate to do the
  50.      work.  C and FORTRAN versions. [f]master1 will spawn 3*<#hosts>
  51.      slave tasks on the virtual machine.
  52.  
  53.      Source files:
  54.          master1.c slave1.c master1.f slave1.f
  55.  
  56.      To compile:    
  57.          % aimk master1 slave1 fmaster1 fslave1
  58.  
  59.      To run from shell (C version):
  60.          % master1
  61.  
  62.      To run from shell (Fortran version)
  63.          % fmaster1
  64.      
  65.      To Run from PVM console:
  66.          pvm> spawn -> master1
  67.  
  68.          OR
  69.  
  70.          pvm> spawn -> fmaster1
  71.  
  72.  
  73.      Sample output:
  74.          Spawning 3 worker tasks ... SUCCESSFUL
  75.          I got 100.000000 from 1; (expecting 100.000000)
  76.          I got 200.000000 from 0; (expecting 200.000000)
  77.          I got 300.000000 from 2; (expecting 300.000000)
  78.  
  79.      MPP Notes:
  80.          If you desire to run the master examples from the shell, then
  81.          you need to compile the "master1h", fmaster1h"
  82.          % aimk master1h fmaster1h
  83.          % master1h
  84.  
  85.  
  86.  ===============================================================
  87.  3.) spmd, fspmd
  88.  
  89.      An SPMD (Single Program Multiple Data) example that uses
  90.      pvm_siblings (pvmfsiblings) to determine the number of tasks
  91.      (and their task ids) that were spawned together. The parallel
  92.      computation then performs a simple token ring and passes a message.
  93.      This program should be run from the pvm console.
  94.  
  95.  
  96.      Source Files:
  97.          spmd.c spmd.f
  98.  
  99.      To compile:
  100.          % aimk spmd fspmd
  101.  
  102.      To run from pvm console:
  103.          pvm> spawn -4 -> spmd
  104.  
  105.          OR
  106.  
  107.          pvm> spawn -4 -> fspmd
  108.  
  109.       Sample output:
  110.          [4:t4000f]  Pass a token through the 4 tid ring:
  111.          [4:t4000f]  262159 ->  262160 ->  262161 ->  262162 ->  262159
  112.          [4:t4000f]  token ring done
  113.  
  114.  
  115.  ===============================================================
  116.  4.) dbwtest, ibwtest, pbwtest, rbwtest
  117.      A simple bandwidth tester. This test uses standard ping-pong type
  118.      tests and illustrates how different packing/sending can affect
  119.      message performance.
  120.  
  121.      This example can be compiled with several different
  122.      options to test different types of packing.
  123.  
  124.      dbwtest - pvm default (PvmDataDefault) packing
  125.      ibwtest - pvm inplace packing (PvmInPlace)
  126.      pbwtest - pvm_psend/precv
  127.      rbwtest - pvm raw data packing (PvmRaw)
  128.  
  129.      Source files:
  130.          bwtest.c
  131.  
  132.      To compile:
  133.          % aimk dbwtest ibwtest pbwtest rbwtest
  134.  
  135.      To run from console:
  136.          pvm> spawn -2 -> dbwtest
  137.  
  138.      To run from the shell:
  139.          machine1% dbwtest
  140.          machine2% dbwtest
  141.      (Note two copies of _bwtest must be running for the code to complete)
  142.  
  143.      Sample output:    
  144.      [4:t40003] --- Simple PVM Bandwidth Test ----
  145.      [4:t40003]  Using pack option: PvmDataDefault
  146.      [4:t40003]  Max data size is: 800000
  147.      [4:t40003]  Number of iterations/sample: 20
  148.      [4:t40003]
  149.      [4:t40003]
  150.      [4:t40003]  Roundtrip time is measured from user-space to user-space.
  151.      [4:t40003]  For packed messages this includes the combined time of:
  152.      [4:t40003]     inst 0: pvm_initsend()
  153.      [4:t40003]     inst 0: pvm_pack()
  154.      [4:t40003]     inst 0: pvm_send()
  155.      [4:t40003]     inst 1: pvm_recv()
  156.      [4:t40003]     inst 1: pvm_unpack()
  157.      [4:t40003]     inst 1: pvm_initsend()
  158.      [4:t40003]     inst 1: pvm_pack()
  159.      [4:t40003]     inst 1: pvm_send()
  160.      [4:t40003]     inst 0: pvm_recv()
  161.      [4:t40003]     inst 0: pvm_unpack()
  162.      [4:t40003]
  163.      [4:t40003]
  164.      [4:t40003] ---------------------------------------
  165.      [4:t40003] 40003 -- I am the master
  166.      [4:t40003] t40003: 100000 doubles received correctly
  167.      [4:t40003]
  168.      [4:t40003]
  169.      [4:t40003] Roundtrip T = 1247 (us)  (0.0000 MB/s)  Data size: 0
  170.      [4:t40003] Roundtrip T = 1090 (us)  (0.0147 MB/s)  Data size: 8
  171.      [4:t40003] Roundtrip T = 1161 (us)  (0.1378 MB/s)  Data size: 80
  172.      [4:t40003] Roundtrip T = 1589 (us)  (1.0069 MB/s)  Data size: 800
  173.      [4:t40003] Roundtrip T = 6556 (us)  (2.4405 MB/s)  Data size: 8000
  174.      [4:t40003] Roundtrip T = 64579 (us)  (2.4776 MB/s)  Data size: 80000
  175.      [4:t40003] Roundtrip T = 668035 (us)  (2.3951 MB/s)  Data size: 800000
  176.  
  177.  
  178.  ===============================================================
  179.  5.) timing + timing_slave:
  180.      A simple program to illustrate how to measure network bandwidth
  181.      and latency.
  182.  
  183.  
  184.  ===============================================================
  185.  6.) hitc + hitc_slave:
  186.      A simplified kernel of a larger supercondutor application,
  187.      hitc illustrates dynamic load balancing using the
  188.      'pool of tasks' paradigm. A synthetic workload is created
  189.      in this example, and hitc automatically places one slave per host.
  190.  
  191.  
  192.  ===============================================================
  193.  7.) gexample, fgexample
  194.  
  195.      Illustrates the use of group functions including reduce f.e. global sum
  196.      and user defined reduce functions.
  197.  
  198.      Source files:
  199.          gexample.c gexample.f
  200.  
  201.      To compile:
  202.          % aimk gexample fgexample
  203.  
  204.      To run from the shell:
  205.          % gexample
  206.  
  207.      To run from the PVM console:
  208.          pvm> spawn -3  -> gexample
  209.  
  210.      Sample output:
  211.  
  212.          [7:t4004f]  This program demonstrates some group and reduction
  213.          [7:t4004f]  operations in PVM.  The output displays the
  214.          [7:t4004f]  the product of the first column of a Toeplitz matrix
  215.          [7:t4004f]  and the matrix 1-norm. The matrix data is distributed
  216.          [7:t4004f]  among several processors.  The Toeplitz matrix is
  217.          [7:t4004f]  symmetric with the first row being the row
  218.          [7:t4004f]  vector [1 2 ... n].
  219.          [7:t4004f]
  220.          [7:t4004f]        --> Using 3 processors <--
  221.          [7:t4004f]
  222.          [7:t4004f]  The 1-Norm is 5050
  223.          [7:t4004f]  ( Should be the sum of the integers from 1 to 100 )
  224.          [7:t4004f]  The product of column 1 is 9.33262e+157
  225.          [7:t4004f]  ( Should be 100 factorial)
  226.  
  227.      MPP Notes:
  228.          MPPs need host versions of programs run from the shell.
  229.          These are the targets gexampleh, fgexampleh.
  230.          
  231.              % aimk gexampleh fgexampleh
  232.              % gexampleh
  233.  
  234.  ***********************************************************************
  235.  ***********************************************************************
  236.  
  237.  The executables are placed in pvm3/bin/ARCH.
  238.  
  239.  Step 1)
  240.  
  241.  Start PVM
  242.  Start up PVM by typing
  243.      pvm  [hostfile]
  244.  This console allows the user to add/delete hosts if desired.
  245.  
  246.  Step 2) Run the desired example
  247.  
  248.  Step 3) Stop PVM
  249.  When the user is through with the virtual machine
  250.  PVM can be shut down by giving 'halt' command to PVM console.
  251.      pvm> halt
  252.  
  253.